<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../layuiadmin/layui/lay/modules/laydate.js" >
  <script src="../../js/vue.js"></script>  <!-- vue追加 -->
  <script src="../../js/axios.min.js"></script>		<!-- vue的AJAX追加 -->
  <script src="../../layuiadmin/layui/layui.all.js"></script>

<style type="text/css">
	#info{
		margin-top: 30px;
		margin-left: 80px;
		
	}
	
</style>

</head>
<body>
<!-- 更改信息页 -->
<h2 id="pagetitle" style="margin-top: 30px;margin-left: 60px">
	<span style="color: red">*</span>个人信息更改页面
</h2>

<div id="updateEmpInfo" style="margin-top: 20px;margin-left: 50px" >
	<div class="layui-col-md7" style="margin-top: 10px">
		<input type="text" name="empId" placeholder="" autocomplete="off" class="layui-input" th:value="${emp.empId}">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原姓名：<span>[[${emp.empName}]]</span>
		<input  v-model="empName"  type="text" name="title" placeholder="请输入姓名" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原密码：<span>[[${emp.empPassword}]]</span>
		<input  v-model="empPassword"  type="text" name="title" placeholder="请输入密码" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原性别：<span>[[${emp.empGender}]]</span>
		<input  v-model="empGender"  type="text" name="title" placeholder="请输入性别" autocomplete="off" class="layui-input">
	</div>
	<!-- <div class="layui-col-md7" style="margin-top: 10px">
		原入职日期：<span>[[${#dates.format(emp.empHiredate,"yyyy-MM-dd")}]]</span>
		<input  v-model="empHiredate"  type="text" name="title" placeholder="请输入入职日期" autocomplete="off" class="layui-input" id="inputDate">
	</div> -->
	<div class="layui-col-md7" style="margin-top: 10px">
		原电话号码：<span>[[${emp.empTel}]]</span>	
		<input  v-model="empTel"  type="text" name="title" placeholder="请输入电话" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原生份证号码：<span>[[${emp.empIdcard}]]</span>	
		<input  v-model="empIdcard"  type="text" name="title" placeholder="请输入身份证号码" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原所属医院编号：<span>[[${emp.hospitalId}]]</span>	
		<input  v-model="hospitalId"  type="text" name="title" placeholder="请输入所属医院编号" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原所属科室编号：<span>[[${emp.officeId}]]</span>	
		<input  v-model="officeId"  type="text" name="title" placeholder="请输入所属科室编号"  autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		原所属部门编号：<span>[[${emp.depId}]]</span>	
		<input  v-model="depId"  type="text" name="title" placeholder="请输入所属部门编号 " autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input type="button"  @click="updateEmp" value="提交修改信息" style="margin-left: 100px" class="layui-btn layui-btn-radius"/><br/>
	</div>
</div>

<script >
	
	var updateEmpInfo=new Vue({
		el:"#updateEmpInfo",
		
		data:{
			empName:"",
			empPassword:"",
			empGender:"",
			empTel:"",
			empIdcard:"",
			hospitalId:"",
			officeId:"",
			depId:"",
			
			
		},
		
		methods:{
			updateEmp:function(){
				axios.get(
					"http://localhost:8080/upEmpInfo",{
						params:{
							empName:this.empName,
							empPassword:this.empPassword,
							empGender:this.empGender,
							empTel:this.empTel,
							empIdcard:this.empIdcard,
							hospitalId:this.hospitalId,
							officeId:this.officeId,
							depId:this.depId,
						}
					}
				).then(data=>{				
					alert(data.data.msg);
				})
			}
			
		}
		
		
	})
</script>

<!-- layui样式渲染 -->
<script >
layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  
	  //执行一个laydate实例
	  laydate.render({
	    elem: '#inputDate' //指定元素
	    ,format: 'yyyy/MM/dd ' //可任意组合
	    ,type: 'datetime'
	  });
	});

</script>

</body>
</html>